package com.ldp.designpatterns.review.create.factory.simplefactory.factory;

import com.ldp.designpatterns.review.create.factory.simplefactory.service.ChessPizza;
import com.ldp.designpatterns.review.create.factory.simplefactory.service.PepperPizza;
import com.ldp.designpatterns.review.create.factory.simplefactory.service.Pizza;

/**
 * @ClassName PizzaFactory
 * @Description 工厂类
 * @Author lindipei
 * @Date 2023/10/20 10:57
 */
public class PizzaFactory {
    public Pizza getPizza(String type){
        if(type.equals("chess")){
            return new ChessPizza();
        }
        if(type.equals("pepper")){
            return new PepperPizza();
        }
        return null;
    }
}
